import http from "@/utils/request"


//获取验证码
export let getCaptchaApi = () => http.get("/users/getCaptcha?v=next");

//验证验证码
export let verifyCaptcha = (captcha)=>http.get("/users/verifyCaptcha",{
    params:{
      captcha
    }
})
//常规登入
export let userLoginApi = (username, password) => http.post("/users/login", {
    username,
    password
})

//手机登入
//获取手机验证码
export let getSmsApi = (phoneNumber) => http.post("/sms/send", {
    phoneNumber
})

//手机登入
export let IponeLogin = (code) => http.post("/users/login?type=sms", {
    code
})


//获取二维码地址
///users/getQrcode

export let getQrcodeApi = sid => http.get("/users/getQrcode",{
    params:{
        sid
    }
})

//微信登入封装
//扫码成功返回字段state、wechatCode、msg
///users/wechatLogin

export let getwechatLogin = wechatCode=>http.get("/users/wechatLogin",{
    params:{
        wechatCode
    }
})

//获取短信验证码
///sms/send||phoneNumber
export let getSmssendApi = phoneNumber=>http.post("/sms/send",{
    phoneNumber
})

//新增手机验证码登入
///users/login?type=sms
//手机接收到的验证码(5位)
//code

export let SmsLogin = code => http.post("/users/login?type=sms",{
    code
})
